/*
 * @Author       : 刘洋 liuy5335@163.com
 * @Date         : 2025-01-25 10:58:34
 * @LastEditors  : 刘洋 liuy5335@163.com
 * @LastEditTime : 2025-02-12 15:54:09
 * @FilePath     : \zhly-vform\src\components\form-designer\refMixinDesign.js
 * @Description  : 介绍文件的作用
 * 
 * Copyright (c) 2025 by zhlx - liuy5335@163.com, All Rights Reserved. 
 */
export default {
  methods: {
    initRefList() {
      if ((this.refList !== null) && !!this.widget.options.name) {
        this.refList[this.widget.options.name] = this
      }
    },

    getWidgetRef(widgetName, showError) {
      let foundRef = this.refList[widgetName]
      if (!foundRef && !!showError) {
        this.$message.error(this.i18nt('render.hint.refNotFound') + widgetName)
      }
      return foundRef
    },

    registerToRefList(oldRefName) {
      if ((this.refList !== null) && !!this.widget.options.name) {
        if (!!oldRefName) {
          delete this.refList[oldRefName]
        }
        this.refList[this.widget.options.name] = this
      }
    },

  }
}
